semvec/pypi-packages huggingface dataset:
presto-drf 0.0.2
Integration package for using django-rest-framework with prestojs
Requires Python: >=3.6
Keywords: rad,rapid application development,drf,rest,django

# Presto DRF

Integration package for using [django-rest-framework](https://www.django-rest-framework.org) with [prestojs](https://github.com/prestojs/)

## Installation

```
pip install presto_drf
```

## API

### Mixins

#### SerializerOptInFieldsMixin

Regulates fields exposed on a Serializer by default & as requested based on query parameters or context.

* Pass 'include_fields' / 'opt_in_fields' thru query params or context to use.
* multiple fields can either be separated by comma eg, `/?include_fields=first_name,email&opt_in_fields=gait_recognition_prediction`
* or passed in the traditional list fashion eg, `/?include_fields=first_name&include_fields=email&opt_in_fields=gait_recognition_prediction`
* or mixed eg, `/?include_fields=first_name,email&include_fields=boo`
* By default, all "fields" defined in serializer, minus those listed in "opt_in_fields" would be returned.
* If "include_fields" is supplied, only fields requested this way would be returned.
* If "opt_in_fields" is supplied, fields requested this way PLUS fields from #1 or #2 would be returned.
* Pinned fields are always returned (defaults to primary key)

Usage:

```python
class UserSerializer(SerializerOptInFieldsMixin, ModelSerializer):
    class Meta:
        model = User
        fields = (
            "id",
            "first_name",
            "last_name",
            "email",
            "region",
            "activated_at",
            "is_staff",
        )
        # These fields only returned if explicitly requested
        opt_in_only_fields = ["activated_at", "is_staff"]
```
gym-cache 1.0.3
gym environment simulating file cache.

# gym-cache
OpenAI based Gym environments for training RL caching agent

install it:
<code>
   pip install gym-cache
</code> 

import it like this:

<code>
import gym

gym.make('gym_cache:Cache-v0')
</code>


observation space has following variables:
* six tokens (integers)
* file size \[kB\]
* how full is the cache at that moment

There are two discrete action environments (*Cache-v0* and *Cache-large-v0*) and one continuous action environment (*Cache-continuous-v0*).


## Data extractions and preprocessing
This is a two step procedure:
* *extract raw data* _data/extract_data.py_ - change PQ, date range
* *process raw data* _data/process_data.py_ - tokenizes filenames, generates unique fileIDs, sorts by access time.

Processed data should be copied to the directory where actor runs.
It is a parque file (.pa) with one dataframe:
* index - access time (sorted)
* six tokens derived from the filename ('1', '2', '3', '4', '5', '6')
* filesize ('kB')
* unique file identifier ('fID')


## Rewards
* always negative and correspond to cost to get the file - if it was cached it will be smaller
* files are cached irrespectively from what action actor performed for the file
* cleanup: environment memorizes actions. on cleanup it first deletes files judged not to be needed again (action 0 in discrete environments or smaller values in continues environment). If multiple files have the same action value, LRU one is removed first.


## Possible technical implementation in XCache server
* There are additional containers in the pod. 
    * environment container
       * recieves gstream pfc, and disk info
       * recalculates new state, reward, tokenizes recieved gstream info. 
       * memorizes last state, actors actions for each file
       * triggers cleanup at lower HWM then xcache itself. Loops through memorized paths and removes ones least probably needed. 
    * redis db - used by environment container to store actor responses
    * actor container 


## Miscalenious

To change environments:
* clone github repository
* make changes
* install locally:    
   <code>  python -m pip install --user -e .  </code>
   or
   <code>
   python setup.py bdist_wheel
   python -m pip install dist\gym_cache-1.0.1-py3-none-any.whl
   </code> 
* to upload to pypi repository
   <code>
   # create %USER%\.pypirc file first. 
   python setup.py bdist_wheel
   python -m twine upload dist\*
   </code>
vt_police_tools 2020.8
Tools for cleaning Vermont police data.
Keywords: police vermont

# Vermont Police Tools
## Tools for cleaning Vermont police data

This package contains miscellaneous tools for working with Vermont police data.
It was created to enable the addition of several police departments to
[OpenOversight](https://www.openoversight.com/).

### Data
See [data](./data/).

### Installation
```sh
pip install vt-police-tools
```

### Usage
```sh
vpt --help
```

### OpenOversight data import
```sh
./scripts/migrations/0000-initial.sh
```

### Development
```sh
git clone https://github.com/brianmwaters/vt-police-tools.git
cd ./vt-police-tools/
virtualenv --python=python3.7 ./env/
source ./env/bin/activate
pip install --requirement requirements.txt
pip install --editable .
```

### Contributing
See the [to-do list](./TODO.md) or contact the authors if you have any
questions. Before submitting a patch, please lint your code by running
`pycodestyle` and `pydocstyle` in the root directory, and `shellcheck` on any
shell scripts you have added or changed, and check that all
[tests](./scripts/tests/) pass.
pyinsta3 1.2
pyinsta3 is a package to get instagram profile info of any user.
Requires Python: >=3.6

# pyinsta3
pyinsta3 is a package to get instagram profile info of any user.

# Installation
```
pip install pyinsta3
```
OR
```
pip3 install pyinsta3
```

# Usage
## Profile Class
```python
from pyinsta3 import Profile

profile = Profile("officialrickastley")
data = profile.get_data()
name = data["full_name"]
print(name)

> Rick Astley
```

## Profile Class
```python
from pyinsta3 import AsyncProfile
import asyncio

async def test():
	profile = AsyncProfile("officialrickastley")
	data = await profile.get_data
	name = data["full_name"]
	print(name)
	
asyncio.run(test())

> Rick Astley
```

Keys in the data dictionary -
```
username
full_name
biography
followers
following
posts
is_private
is_verified
profile_pic_url
```