Releases: seijihirao/apys
Apys v3.2.1
Fix
Filter text on startup
Apys v3.1.5
Fix
Duplicate logs not happening anymore when using cli
Apys v3.1.4
Fixes
Minor fixes
CI/CD
Now the project has the lovely github CD <3
Apys v3.1.0
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 theAPI_KEY
environment variable, or '$API_KEY' if env var does not existsdb_url
will now have the value of theDB
environment variable, or 'localhost' if env var does not existsport
will now have the value of thePORT
environment variable, or 8080 if env var does not exists
Apys v3.0.0
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
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
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
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
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
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
andapi.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