Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Releases: seijihirao/apys

Apys v3.2.1

23 Jun 05:45
Compare
Choose a tag to compare

Fix

Filter text on startup

Apys v3.1.5

02 Jun 04:05
Compare
Choose a tag to compare

Fix

Duplicate logs not happening anymore when using cli

Apys v3.1.4

26 May 00:50
Compare
Choose a tag to compare

Fixes

Minor fixes

CI/CD

Now the project has the lovely github CD <3

Apys v3.1.0

20 Feb 23:24
Compare
Choose a tag to compare

New Features

Environment Variables on Config

You can now use environment variables
like $PORT (for PORT env var), and set a default value if no env var is found
like $PORT|8080 or $PORT|8080|int (if type is needed)

i.e.:

{
    "key": "$API_KEY"
    "db_url": "$DB|localhost"
    "port": "$PORT|8080|int"
}
  • key will now have the value of the API_KEY environment variable, or '$API_KEY' if env var does not exists
  • db_url will now have the value of the DB environment variable, or 'localhost' if env var does not exists
  • port will now have the value of the PORT environment variable, or 8080 if env var does not exists

Apys v3.0.0

20 Feb 21:57
Compare
Choose a tag to compare

New Features

Json translation

Now received

{
    "var1.0": "value0", 
    "var1.1": "value1",
    "var2.key1": "value2",
    "var2.key2": "value3"
}

will be

{
    "var1": [
        "value0", 
        "value1"
    ],
    "var2": {
        "key1": "value2",
        "key2": "value3"
    }
}

Dropped Features

Json translation

Before received

{
    "var1[0]": "value0", 
    "var1[1]": "value1",
    "var2[key1]": "value2",
    "var2[key2]": "value3"
}

would be

{
    "var1": [
        "value0", 
        "value1"
    ],
    "var2": {
        "key1": "value2",
        "key2": "value3"
    }
}

Now apys uses the new syntax above.

Apys v2.0.0

23 Sep 23:31
Compare
Choose a tag to compare

Features

Utils

Now you have to select what utils will be loaded on config, and on what order.

{
    "util": [
         "util1",
         "util2"
    ]
}

i.e.: demo/hello_world

Filters

You can now import filters inside a list, so if one of them doesn't return an error all error will be ignored and the flow will continue.

filters = [
    'filter1',
    ['filter2', filter3]
]

i.e.: demo/user_roles

Apys v1.0.0

28 Aug 02:44
Compare
Choose a tag to compare
Apys v1.0.0 Pre-release
Pre-release

New Features

Utils

Now utils have only the init functionality

It needs to be inside a dir and has some special files:

init.py

This file contains the init function that will be called before initializing the api.

It doesn't need to be included inside your endpoint anymore, as it has no connection

Filters

The code called before every request is now inside the filters dir (the [method] and any functions)

Apys v0.6.0

22 Aug 00:45
Compare
Choose a tag to compare
Apys v0.6.0 Pre-release
Pre-release

New Features

Utils

Utils now require a subdir to work, and a file named __init__

Old:

root/
    utils/
        my_lib.py

New:

root/
    utils/
        my_lib/
            __init__.py

req.params

req.params removed, you now have to use req.body or req.query from aiohttp now.

Apys v0.5.0

29 Oct 23:51
Compare
Choose a tag to compare
Apys v0.5.0 Pre-release
Pre-release

New Features

Json translation

Now received

{
    "var1[0]": "value0", 
    "var1[1]": "value1",
    "var2[key1]": "value2",
    "var2[key2]": "value3"
}

will be

{
    "var1": [
        "value0", 
        "value1"
    ],
    "var2": {
        "key1": "value2",
        "key2": "value3"
    }
}

Apys v0.3.0

06 Oct 23:14
Compare
Choose a tag to compare
Apys v0.3.0 Pre-release
Pre-release

New Features

Custom config file

Now it's possible to use custom config files, instead of depending on the old local -> dev -> prod order.

$ apys -s --config=my_config

or

$ apys -s -c my_config

Log files

Log is not fixed to std anymore, now you can choose a file to log

You can choose a unique log file

{
    "log": {
        "file": "myfile.log"
    }
}

Or one for debug and one for errors

{
    "log": {
        "file": {
            "debug": "mydebugfile.log",
            "error": "myerrorfile.log"
        }
    }
}

Knowing that you will have to log with api.debug and api.error

Also, you can define a custom log file

{
    "log": {
        "file": {
            "debug": "mydebugfile.log",
            "error": "myerrorfile.log",
            "custom": "mycustomfile.log"
        }
    }
}

And then call it on log:

api.debug('my message', to='custom')

Example

See demo/log_to_file for an example