semvec/pypi-packages huggingface dataset:
tinyconf 0.3.0
A declarative config parsing library

# tinyconf
## A small library for declarative config interpretation

### Installing 

* Download `tinyconf`
* `pip install .` within the folder
* `import tinyconf`
* `tinyconf.__version__`

### Usage

An example usage:

`main.py`
```
from tinyconf.deserializers import IniDeserializer
from tinyconf.fields import *

class Config(IniDeserializer):
    token = Field(strict=True) # Loads field called 'token'. Fails if not present

    client_id = IntegerField('client') # Loads field called 'client'

    api_version = Field('apiv', default="8") # Loads field called 'apiv', if not present uses "8"

    permitted_users = ListField(map=lambda x: int(x.strip()), default=[], delimiter=";")


config = Config(filename="conf.ini", section="DEFAULT")

assert(config.token == "abcdefghijklmno")
assert(config.client_id == 123456789)
assert(config.api_version == "8")
assert(config.permitted_users == [1111, 2222])
```

`conf.ini`
```
[DEFAULT]
token = "abcdefghijklmno"
client = 123456789
permitted_users = 1111; 2222
```

### Docs

https://tinyconf.readthedocs.io/en/latest/tinyconf.html

Docs can be built with Sphinx in `docs` folder
django-firebase-scrypt 0.0.2
A Django password hasher to use for users imported from Firebase

# django_firebase_scrypt
A Django password hasher based off scrypt to use for user accounts imported from Firebase.

## Installation
Install dependencies according to your Python version and OS:
```
# Debian/Ubuntu
$ sudo apt-get install build-essential libssl-dev python-dev

# Fedora, RHEL
$ sudo yum install gcc openssl-devel python-devel

# Alpine Linux (Docker Containers)
$ apk add gcc openssl-dev python-dev

# (If you're on Python3, install the Python3 versions of the above packages)

# Mac
# Without setting the flags below, install will fail to find the necessary files
$ brew install openssl
$ export CFLAGS="-I$(brew --prefix openssl)/include $CFLAGS"
$ export LDFLAGS="-L$(brew --prefix openssl)/lib $LDFLAGS"
```

Then install this package
```
pip install django-firebase-scrypt
```

## Usage
Add this to your hashers `settings.py` like so
```
PASSWORD_HASHERS = (
  'django_firebase_scrypt.FirebaseScryptPasswordHasher',
  'django.contrib.auth.hashers.PBKDF2PasswordHasher',
  'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
  'django.contrib.auth.hashers.SHA1PasswordHasher',
  'django.contrib.auth.hashers.MD5PasswordHasher',
  'django.contrib.auth.hashers.CryptPasswordHasher',
  'django.contrib.auth.hashers.Argon2PasswordHasher',
  'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
)

# Retrieve these from  the Firebase console - see https://firebaseopensource.com/projects/firebase/scrypt/
FIREBASE_SIGNER_KEY = "jxspr8Ki0RYycVU8zykbdLGjFQ3McFUH0uiiTvC8pVMXAn210wjLNmdZJzxUECKbm0QsEmYUSDzZvpjeJ9WmXA=="
FIREBASE_SALT_SEPARATOR = "Bw=="
FIREBASE_ROUNDS = 8
FIREBASE_MEMCOST = 14
```


You can also move `FirebaseScryptPasswordHasher` to the bottom of your hashers if you only want to use it to validate 
old, migrated hashes instead of generating them for new users.

## Migration
Migrate your Firebase users to Django.  You can do so as follows:
```
# Grab your users and their password hashes using the auth:export command
$ auth:export users.json
```

```
import json

import django
django.setup()
from django.contrib.auth import get_user_model

from django_firebase_scrypt import FirebaseScryptPasswordHasher

User = get_user_model()

with open("users.json", "r") as user_file:
    firebase_users = json.load(user_file)["users"]

for firebase_user in firebase_users:
    django_password = f"{FirebaseScryptPasswordHasher.algorithm}${firebase_user['salt']}${firebase_user['passwordHash']}"
    django_user = User(email=firebase_user["email"], password=django_password, ...any_other_user_fields)
    django_user.save()
```
mgraphql 0.0.5
Python library link with graphql

# mgraphql
Python library link with graphql

------------------------------------------------

```
from mgraphql import Mgraphql
```

```
query ="""
{
  viewer {
    login
  }
  rateLimit {
    limit
    cost
    remaining
    resetAt
  }
}
"""
```

```
variables = {

your variables

type Python Dictionary 

}
```

```
url = 'https://api.github.com/graphql'
```

# token default none
```
mgraph = Mgraphql(url,token)
```

```
query =mgraph.query(query)
```

```
mutation =mgraph.mutation(query,variables)
```

```
print(mutation)
print(query)
```