-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Edimedia Mutoke
committed
Jan 20, 2024
1 parent
135772d
commit adfff6c
Showing
99 changed files
with
11,506 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/__pycache__ | ||
/__pypackages__ | ||
/src/api | ||
/**/__pycache__ | ||
/**/**/__pycache__ | ||
db.sqlite3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/usr/bin/python3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"python.analysis.extraPaths": [ | ||
"${workspaceFolder}/__pypackages__/3.10/lib" | ||
], | ||
"python.autoComplete.extraPaths": [ | ||
"${workspaceFolder}/__pypackages__/3.10/lib" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Adding packages to default dependencies: pydantic | ||
🔒 Lock successful | ||
Changes are written to pyproject.toml. | ||
Synchronizing working set with resolved packages: 3 to add, 0 to update, 0 to remove | ||
|
||
✔ Install annotated-types 0.6.0 successful | ||
✔ Install pydantic 2.5.2 successful | ||
✔ Install pydantic-core 2.14.5 successful | ||
Installing the project as an editable package... | ||
✔ Update oya 0.1.0+editable -> 0.1.0 successful | ||
|
||
🎉 All complete! | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
# oya | ||
A thin functionnal layer over litestar and tortoise-orm | ||
The thin functional layer above Litestar for DX, inspireb by the best of django |
Binary file not shown.
Binary file not shown.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Welcome to Oya | ||
|
||
Oya is a thin fonctionnal layer over litestar and tortoise orm, designed with fast templating in mind. | ||
|
||
## Installation | ||
|
||
to install oya type this command | ||
|
||
$ pip install https://github.com/oya-0.1.gz | ||
|
||
## CLI Usage | ||
* `oya project_name -p [or --project]` - Create a new project. | ||
* `oya project_name --project --directory MyappFolder` - Create new in the target directory. | ||
* `oya app_name -a [or --application] [--directory MyAppFolder]` - Create new app like django application. | ||
* `oya --version` - show the installed oya version | ||
* `oya --help` - Print help message and exit. | ||
|
||
## Project layout | ||
After project is created, this will be the project structure | ||
|
||
$ oya MyProject --project | ||
|
||
This will the result : | ||
|
||
MyProject/ # The configuration file. | ||
MyProject/ | ||
main.py # this file contains the definition of the litestar application install. | ||
settings.py # the oya settings file | ||
manage.py # oya shell interface | ||
|
||
## Application layout | ||
Application must be created in a project folder, by the following command | ||
|
||
$ oya MyApp --application | ||
|
||
Or by targeting the project folder | ||
|
||
$ oya MyApp --application --directory MyProject | ||
|
||
This will the result : | ||
|
||
MyProject/ # The configuration file. | ||
MyProject/ | ||
main.py # this file contains the definition of the litestar application install. | ||
settings.py # the oya settings file | ||
manage.py # oya shell interface | ||
|
||
myapp/ | ||
apps.py | ||
endpoints.py | ||
models.py | ||
tests.py | ||
|
||
[!NOTE] | ||
the application's name must be a valid identifier | ||
|
||
|
||
## Version & Help | ||
|
||
Check oya version | ||
|
||
$ oya --version | ||
|
||
print the page | ||
|
||
$ oya --help |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
site_name: Oya documentation | ||
|
||
theme: | ||
name: mkdocs | ||
locale: en | ||
analytics: {gtag: 'G-274394082'} | ||
highlightjs: true | ||
hljs_languages: | ||
- yaml | ||
- python | ||
|
||
nav: | ||
- Home : index.md | ||
- 'Usage Guide' : | ||
- 'Get Started' : usage.md | ||
- 'Static Files' : static.md | ||
- 'Templates' : templates.md | ||
- 'Models & Fields' : models.md | ||
- Serialization : serialization.md | ||
- Tests : tests.md | ||
- 'Security' : config.md | ||
- About : about.md | ||
|
||
copyright: Copyright © 2023 <a href="https://oyabytes.com/">OyaBytes</a>. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
[project] | ||
name = "oya" | ||
version = "0.1.0" | ||
description = "Small functional layer above Litestar" | ||
authors = [ | ||
{name = "Edimedia Mutoke", email = "[email protected]"}, | ||
] | ||
dependencies = [ | ||
"tortoise-orm>=0.20.0", | ||
"litestar[standard]>=2.4.1", | ||
"pydantic>=2.5.2", | ||
"dictdiffer>=0.9.0", | ||
"ptpython>=3.0.23", | ||
"typing-extensions>=4.8.0", | ||
"typeguard>=4.1.5", | ||
"black>=23.12.0", | ||
"mkdocs>=1.5.3", | ||
] | ||
requires-python = ">=3.9" | ||
readme = "README.md" | ||
license = {text = "MIT"} | ||
|
||
[build-system] | ||
requires = ["pdm-backend"] | ||
build-backend = "pdm.backend" | ||
|
||
[tool.pdm.scripts] | ||
start = "src/manage.py runserver" | ||
manage = "src/manage.py " | ||
|
||
[project.scripts] | ||
oya = "oya.core.initializer.starter:main" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
aiosqlite==0.17.0 | ||
annotated-types==0.6.0 | ||
anyio==4.0.0 | ||
appdirs==1.4.4 | ||
async-timeout==4.0.3 | ||
asyncpg==0.29.0 | ||
black==23.11.0 | ||
certifi==2023.11.17 | ||
click==8.1.7 | ||
colorama==0.4.6 | ||
dictdiffer==0.9.0 | ||
exceptiongroup==1.1.3 | ||
Faker==20.0.3 | ||
h11==0.14.0 | ||
httpcore==1.0.2 | ||
httpx==0.25.1 | ||
idna==3.4 | ||
iso8601==1.1.0 | ||
jedi==0.19.1 | ||
Jinja2==3.1.2 | ||
litestar==2.3.2 | ||
markdown-it-py==3.0.0 | ||
MarkupSafe==2.1.3 | ||
mdurl==0.1.2 | ||
msgspec==0.18.4 | ||
multidict==6.0.4 | ||
mypy-extensions==1.0.0 | ||
packaging==23.2 | ||
parso==0.8.3 | ||
pathspec==0.11.2 | ||
platformdirs==4.0.0 | ||
polyfactory==2.12.0 | ||
prompt-toolkit==3.0.41 | ||
ptpython==3.0.23 | ||
pydantic==2.5.1 | ||
pydantic_core==2.14.3 | ||
Pygments==2.17.1 | ||
pypika-tortoise==0.1.6 | ||
python-dateutil==2.8.2 | ||
pytz==2023.3.post1 | ||
PyYAML==6.0.1 | ||
rich==13.7.0 | ||
rich-click==1.7.1 | ||
six==1.16.0 | ||
sniffio==1.3.0 | ||
tomli==2.0.1 | ||
tortoise-orm==0.20.0 | ||
typing_extensions==4.8.0 | ||
uvicorn==0.24.0.post1 | ||
wcwidth==0.2.10 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env python | ||
""" | ||
From django | ||
Oya's command-line utility for administrative tasks.""" | ||
import os | ||
import sys | ||
|
||
|
||
|
||
def main(): | ||
"""Run administrative tasks.""" | ||
os.environ.setdefault('OYA_SETTINGS_MODULE', 'api.settings') | ||
try: | ||
from oya.core.management import execute_from_command_line | ||
except ImportError as exc: | ||
raise ImportError( | ||
"Couldn't import Oya. Are you sure it's installed and " | ||
"available on your PYTHONPATH environment variable? Did you " | ||
"forget to activate a virtual environment?" | ||
) from exc | ||
execute_from_command_line(sys.argv) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__version__ = "0.0.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from oya.core.initializer.starter import main | ||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from .config import AppConfig | ||
from .registry import apps | ||
|
||
__all__ = ["AppConfig", "apps"] |
Oops, something went wrong.