Apys

Latest version: v3.2.1

Safety actively analyzes 628936 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 2

1.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)

0.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.

0.5.0

New Features

Json translation

Now received

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


will be

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

0.4.0

New Features

Versioning system

Now you can see apys version from command line

shell
$ apys -v


or

shell
$ apys --version

0.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

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


Or one for debug and one for errors

json
{
"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

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


And then call it on log:

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


Example

See [demo/log_to_file](https://github.com/seijihirao/apys/tree/master/demo/log_to_file) for an example

Page 2 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.