Giter Club home page Giter Club logo

python-fm's Introduction

Flitsmeister: python-fm

Asyncio package to communicate with Flitsmeister This package is aimed to get basic information about your Flitsmeister account.

❗This is an unofficial repo and is not created, maintained or in any sense linked to Flitsmeister. Use at your own risk!

Usage

Instantiate the FM class and access the data.

Installation

python3 -m pip install python-fm

Example

import asyncio
from flitsmeister import FM
from flitsmeister.models import Auth

async def main():

    async with FM() as api:
        auth = await api.login(USERNAME, PASSWORD)

    # - Persist auth in a file or database
    # - Create a new auth object from the persisted data

    auth = Auth(session_token=SESSION_TOKEN, access_token=ACCESS_TOKEN)
    async with FM(auth=auth) as api:
        print(await api.user())
        print(await api.statistics())

if __name__ == "__main__":
    asyncio.run(main())

Development and contribution

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Feel free to take a look a the open issues if you like to contribute.

Requirements

Installation and setup

poetry install
poetry shell
pre-commit install

You can now start developing. The pre-commit hooks will run automatically when you commit your changes. Please note that a failed pre-commit hook will prevent you from committing your changes. This is to make sure that the code is formatted correctly and that the tests pass.

python-fm's People

Contributors

dependabot[bot] avatar dcsbl avatar

Stargazers

Frank Bouwens avatar

Watchers

 avatar

python-fm's Issues

Implement token refreshing

The session token is not refreshed at all. This will break the implementation when te token expires. We should add a refresh method.

Add basic unit tests

Currently there are no tests. It would be nice if we add at least some to validate proposed changes

Implement request error handling

Every requests is just doing its thing, while we do not check for any error. This is a bit intentional because we do not know the error yet.

When we collect some common errors, we should add some error handlers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.