Skip to content

Commit

Permalink
create closureModel
Browse files Browse the repository at this point in the history
  • Loading branch information
Edimedia Mutoke committed Jan 20, 2024
1 parent 135772d commit adfff6c
Show file tree
Hide file tree
Showing 99 changed files with 11,506 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/__pycache__
/__pypackages__
/src/api
/**/__pycache__
/**/**/__pycache__
db.sqlite3
1 change: 1 addition & 0 deletions .pdm-python
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/usr/bin/python3
8 changes: 8 additions & 0 deletions .vscode/settings.json
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"
]
}
13 changes: 13 additions & 0 deletions =2.5
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!

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 OyaBytes
Copyright (c) 2023 Edimedia Mutoke

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
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 added dist/oya-0.1.0-py3-none-any.whl
Binary file not shown.
Binary file added dist/oya-0.1.0.tar.gz
Binary file not shown.
Empty file added docs/docs/about.md
Empty file.
Empty file added docs/docs/config.md
Empty file.
66 changes: 66 additions & 0 deletions docs/docs/index.md
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 added docs/docs/models.md
Empty file.
Empty file added docs/docs/serialization.md
Empty file.
Empty file added docs/docs/static.md
Empty file.
Empty file added docs/docs/templates.md
Empty file.
Empty file added docs/docs/tests.md
Empty file.
Empty file added docs/docs/usage.md
Empty file.
24 changes: 24 additions & 0 deletions docs/mkdocs.yml
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 &copy; 2023 <a href="https://oyabytes.com/">OyaBytes</a>.
1,507 changes: 1,507 additions & 0 deletions pdm.lock

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions pyproject.toml
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"
50 changes: 50 additions & 0 deletions requirements.txt
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
25 changes: 25 additions & 0 deletions src/manage.py
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()
1 change: 1 addition & 0 deletions src/oya/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.0.1"
4 changes: 4 additions & 0 deletions src/oya/__main__.py
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()
4 changes: 4 additions & 0 deletions src/oya/apps/__init__.py
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"]
Loading

0 comments on commit adfff6c

Please sign in to comment.