semvec/pypi-packages huggingface dataset:
substratecore 20240311.0
Autogenerated models and serialization for the Substrate API and SDKs
Requires Python: >=3.10,<4

# Substrate

# Next apps

- Initial setup: go to dashboard, docs, explore and run `yarn`
- Then go back to the root

```
# (when switching between dashboard/docs/explore)
npx vc link

# (pull new env vars into linked next project)
npx vc pull .env.development.local

# (run linked next project)
npx vc dev
```

# Python

- The preferred way to set up an environment is via `poetry`. [Install poetry by following these instructions](https://python-poetry.org/docs/).
- Install dependencies:
  - `make ensure`
- (Recommended) Set up the git pre-commit hook that runs `ruff check --fix`
  - `poetry run pre-commit install`

## Codegen

- See [`/openapi.json`](/site/public/openapi.json) for our Open API spec
- Some python code is generated automatically from this spec
  - `substrate.run/library` is dynamically rendered based on this spec
- To regenerate code after updating the spec:
  - `make generate`
- To publish `substratecore` to pypi for `substrate-python`:
  - `make _version.py` -> inspect the diff
  - `make publish`

## Local development

- You can develop an individual file locally using `poetry run modal run` with a `local_entrypoint` defined in a file.

```

poetry run modal run sb_models/sdxl/sdxl.py --prompt "cinematic ..."

```

## Staging

Use the `deploy-modal` script to deploy to staging:

```

poetry run ./scripts/deploy-modal.py --apps=usage --env=staging

```

And then use `https://api-staging.substrate.run`

(Note that this also uses the staging deploy of `sb-proxy`)

Commits to main are automatically deployed to `--env=main` via Github action.

## Creating your own modal environment

1. [`poetry run modal environment create`](https://modal.com/docs/guide/environments#environments-beta)
2. update the deploy script with your environment
3. run the deploy script with `--apps=all`
4. update `sb-proxy` with your environment

# Billing

- We use Orb for billing. Managing new prices requires juggling a bunch of scripts.
- See [`billing.md`](/internal-docs/billing.md)
- [`usage.py`](/sb_models/usage.py) is where we report usage to Orb.

# Observability

- `sb-proxy` logs the start and end of requests, and reports overall timing metrics
- [`usage.py`](/sb_models/usage.py) logs more extensive, redacted request info from inference runs

```

```
roachcase 0.3.5
A match making algorithm to create balanced teams from players with different skills.
Requires Python: >=3.8
Keywords: games,ladder,match making


==============
The roach case
==============

.. image:: https://readthedocs.org/projects/roachcase/badge
        :target: https://roachcase.readthedocs.io/en/latest
        :alt: Documentation Status

.. image:: https://img.shields.io/pypi/v/roachcase.svg
        :target: https://pypi.python.org/pypi/roachcase

.. image:: https://github.com/stefanoberri/roachcase/actions/workflows/test-package.yml/badge.svg
        :target: https://github.com/stefanoberri/roachcase/actions/workflows/test-package.yml


.. image:: https://roachcase.readthedocs.io/en/latest/_images/roachcase.png
  :width: 400
  :alt: The roach case
  :align: center


A match making algorithm
------------------------

The roach case is a match making algorithm to create balanced teams from players
with different skills. It has two purposes:

* Iteratively score player's skill level based on the outcome of played
  matches.

* Use the player's latest scores to create balanced teams.


Scores are converted into *roaches* each players has in the *roach case*. *Roaches*
are traded after each match, depending on the outcome.

It is inspired by the `ELO scoring system`_ used in chess and other games.

A Python package
----------------

This Python package contains the *business logic* of the match making
algorithm, together with a very simple *command line interface* and simple
persistence layers. Other components can use it and extend it with a different
interface (web, standalone, ...) and more scalable persistence (local or cloud
database). Design is heavily inspired by `Clean Architecture`_ and/or `Onion
Architecture`_.

Documentation
-------------

Please read the latest `documentation`_ online

Credits
-------

Stefano Berri

.. _Elo scoring system: https://en.wikipedia.org/wiki/Elo_rating_system
.. _Clean Architecture: https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-architecture.html
.. _Onion Architecture: https://jeffreypalermo.com/2008/07/the-onion-architecture-part-1/
.. _documentation: https://roachcase.readthedocs.io/en/latest/