Metadata-Version: 2.4
Name: underscorepy
Version: 0.10.0
Summary: _.py library
Author-email: Matthew Shaw <mshaw.cx@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://shaw.cx/_.py
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Libraries
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: tornado>=6.3
Requires-Dist: sqlalchemy[asyncio]>=2
Provides-Extra: postgres
Requires-Dist: asyncpg; extra == "postgres"
Provides-Extra: sqlite
Requires-Dist: aiosqlite; extra == "sqlite"
Provides-Extra: redis
Requires-Dist: redis>=5.0.1; extra == "redis"
Provides-Extra: protobuf
Requires-Dist: protobuf>=5.26; extra == "protobuf"
Provides-Extra: ldap
Requires-Dist: python-ldap; extra == "ldap"
Provides-Extra: migrations
Requires-Dist: alembic; extra == "migrations"
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: aiosqlite; extra == "test"
Requires-Dist: alembic; extra == "test"
Provides-Extra: all
Requires-Dist: underscorepy[ldap,migrations,postgres,protobuf,redis,sqlite]; extra == "all"
Dynamic: license-file


underscore.py
-------------

```INI
[myapp]
address = 0.0.0.0
port    = 8080
```

```Python
import _
import _.websockets

class Echo(_.websockets.WebSocket):
    def on_message(self, msg):
        print('Echo:', msg)
        self.write_message(msg)

class MyApp(_.Application):
    def initialize(self):
        self.patterns = [
            ( r'/ws',       Echo                ),
            ( r'/([a-z]*)', _.handlers.Template ),
            ]

MyApp.main()
```

Look at the skeleton directory for a more complete example application.

Schema changes
--------------

Tables for records are created when the database is empty. After that, each
start compares the models (for example your `.proto` messages) with the
database and refuses to run if they differ:

```
ERROR    Database "store" differs from the schema:
  ALTER TABLE "Reports_multiple" ADD COLUMN _position INTEGER
Run with --store-migrate to apply them
```

`--<database>-migrate` applies changes that can't lose data. Drops and type
changes are printed as SQL to run by hand. This needs `alembic`
(`pip install underscorepy[migrations]`); set `check_schema = false` in the
database's section to skip the check.
