Giter Site home page Giter Site logo

pyneer's Introduction

Intro

Pyneer is a minimal scaffolding designed to help students with their school's Python assignments.

Pyneer comes with minimal scaffolding as well as basic authentication and admin functionality to help you quickly get started with your project. It comes with a MongoDB-like API out of the box, so you can focus on what's important to be done !

Make sure to give it a โญ if you like the project ๐Ÿ‘.

Requirement

python - ^3.10*

Installation

Make sure you have git installed to clone the project or download the zip file.

git clone https://github.com/jameswong3388/Pyneer.git

Project Structure Overview

.
โ”œโ”€โ”€ main.py
โ”œโ”€โ”€ app
โ”‚   โ””โ”€โ”€ helpers.py
โ”œโ”€โ”€ api
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ””โ”€โ”€ pyneer
โ”‚       โ””โ”€โ”€ db
โ”‚           โ”œโ”€โ”€ __init__.py
โ”‚           โ””โ”€โ”€ handlers
โ”œโ”€โ”€ database
โ”‚   โ”œโ”€โ”€ db.json
โ”‚   โ””โ”€โ”€ db.txt
โ””โ”€โ”€ pages
    โ”œโ”€โ”€ admin.py
    โ”œโ”€โ”€ auth.py
    โ””โ”€โ”€ user.py

main.py - Here is where Pyneer is initialized.

\app - Here contain all of your application logic.

\api - Here contain all the API-related files, and all of Pyneer's APIs are here.

\database - Here contain the database related file, Pyneer supports .json and .txt file.

\pages - Here contain your pages, and all of Pyneer's scaffolding pages are here.

API overview

db.* - With Pyneer's database API, you can easily execute CRUD operations on your database. Pyneer uses db.json as the database file by default, but you can easily change it when calling the APIs.

Documentation

You can find more detailed API documentation in \api\pyneer\db\__init__.py or here.

Usage

# An example using Pyneer's `db.*` API to create a new user
from api.pyneer import db

# Create a new database
a = db.create_db("database/users.json")

# Return: {"action": True}

# Create a new collection
b = db.create_collection("database/users.json", "users")

# Return: {"action": True}

# Create a new user
c = db.insert_one(collection="users", document={
    "username": "jameswong3388",
    "password": "password",
    "email": "[email protected]",
    "age": 18,
    "gender": 'm'
}, db_path="users/db.json")

# Return: {'action': True, '_id': '6b0baf4d-5ddf-5f55-869c-5d8f9ba3f923'}

Running the project

To run the project, simply run main.py with python or python3.

python main.py

Bugs and Issues

If you find any bugs or issues, please report it to the issue tracker

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.