semvec/pypi-packages huggingface dataset:
cache-manager 0.1
Simple cache manager
License: MIT

# Cache manager

Простой кеш - хранение в файлах:

```python
from cache_manager.pickle import PickleCache
from datetime import timedelta

cache_manager = PickleCache('./cache')

@cache_manager(ttl=timedelta(hours=1))
def some_function():
    pass
    
```

Memcached:
```python
from cache_manager.memcached import MemcachedCache
from datetime import timedelta

cache_manager = MemcachedCache(('10.5.0.11', 11211)) # в случае соединения по TCP или UDP сокету
cache_manager = MemcachedCache('/usr/run/memcached.sock') # в случае соединия по unix сокету

@cache_manager(ttl=timedelta(hours=1))
def some_function():
    pass
    
```

Redis:
```python
from cache_manager.redis import RedisCache
from datetime import timedelta

cache_manager = RedisCache(('10.5.0.11', 6379), password='somepassword') # в случае соединения по TCP или UDP сокету
cache_manager = RedisCache('/usr/run/redis.sock', password='somepassword') # в случае соединия по unix сокету

@cache_manager(ttl=timedelta(hours=1))
def some_function():
    pass
    
```


Etcd:
```python
from cache_manager.etcd import EtcdCache
from datetime import timedelta

cache_manager = EtcdCache(('10.5.0.11', 2371), scheme='http')

@cache_manager(ttl=timedelta(hours=1))
def some_function():
    pass
    
```
trlocal-backup 0.1.0
a local backup tool for transmission without call remote rpc.
License: MIT
Requires Python: >=3.8,<4.0

# trlocal_backup

a local backup tool for transmission without call remote rpc.

## Usage

``` cmd
python -m trlocal_backup <TRANSMISSION_CONF> <DEST_LOCATION>
```

`<DEST_LOCATION>` should be a directory.
pony_wtf 0.0.1.post4
Create WTF-Form from your pony database entity
License: MIT
Keywords: pony ponyorm wtf wtf-form

Pony-WTF
========

Pony-WTF is an integration library for Ponyorm and WTF-Forms.

Installation
------------

.. code:: bash

   pip install pony-wtf

Usage
-----

::

   # imports from pony-wtf
   from pony_wtf import model_form
   from pony_wtf.utils import get_attrs_dict


   # declare database entities
   class User(db.Entity):
       id = PrimaryKey(int, auto=True)
       email = Required(str, unique=True)
       age = Optional(int)

   form_cls = model_form(User, ) 
   form = form_cls()

   def get_form_values(entity, form_data):
       """ Get form values and return them as dict """
       d = {}
       adict = get_attrs_dict(entity)
       for k in adict:
           if k in form_data:
               d[k] = form_data.get(k)
       return d


   @app.route('/create_user', methods=['GET', 'POST'])
   def create_user():
       form_cls = model_form(User)
       form = form_cls()  # instaniatte the class

       if request.method == 'POST' and form.validate_on_submit():
           data = get_form_values(User, form.data)
           with db_session:
               User(**data)
           flash("User Created", "success")
           return redirect(url_for("index"))
       return render_template('create_user.html',  form=form)

You can render the form as you prefer in the jinjaHTML. Ex:
``{# Use Flask-WTF and Flask-Bootstrap #}     {{ wtf.quick_form(form) }}``

Requirements
------------

::

   pony
   pony_wtf
   Flask_WTF
   WTForms

Contributing
------------

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

Please make sure to update tests as appropriate.

License
-------

[MIT]