Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
truethari committed Feb 21, 2022
1 parent d4484b3 commit 6bcf82b
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 13 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Upload Python Package

on:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: ReallySimpleDB tests
name: tests

on:
push:
Expand Down
30 changes: 19 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
<h1 align="center">
<center><h1>
ReallySimpleDB 🧩

<img src="assets/images/ReallySimpleDB.png" alt="Icon" height="300"> </img>

[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/09b9e60691484c29b4cac87178b8aaae)](https://www.codacy.com/gh/truethari/ReallySimpleDB/dashboard?utm_source=github.com&utm_medium=referral&utm_content=truethari/ReallySimpleDB&utm_campaign=Badge_Grade)

</h1>

---

**🔧 This is still in development and may cause errors when using certain functions.**
<img src="assets/images/ReallySimpleDB.png" alt="Icon" height="300"> </img>

---
[![PyPI version](https://img.shields.io/pypi/v/ReallySimpleDB.svg?logo=pypi&logoColor=FFE873)](https://pypi.org/project/ReallySimpleDB/) [![tests](https://github.com/truethari/ReallySimpleDB/actions/workflows/tests.yml/badge.svg?branch=alpha)](https://github.com/truethari/ReallySimpleDB/actions/workflows/tests.yml) [![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/) [![Codacy Badge](https://app.codacy.com/project/badge/Grade/09b9e60691484c29b4cac87178b8aaae)](https://www.codacy.com/gh/truethari/ReallySimpleDB/dashboard?utm_source=github.com&utm_medium=referral&utm_content=truethari/ReallySimpleDB&utm_campaign=Badge_Grade) [![PyPI downloads](https://img.shields.io/pypi/dm/reallysimpledb.svg)](https://pypistats.org/packages/reallysimpledb)

## What is This

---

This is a Python application that can be used to manage **sqlite** databases without using any sql command.

</center>

## 🚀 Installation

You can use pip:

~~pip3 install ReallySimpleDB~~
```console
pip3 install ReallySimpleDB
```

or

Expand Down Expand Up @@ -75,13 +72,15 @@ If you want to add columns to an existing table, read the **Add column to table*

```console
>> all_tables = _dbmanager.all_tables()

["STUDENT", "EXAM"]
```

### Check table if exists

```console
>> _dbmanager.is_table(database="test.db", table_name="STUDENTS")

True
```

Expand All @@ -101,27 +100,31 @@ True

```console
>> _dbmanager.get_columns(table="STUDENTS")

["student_id", "name", "mark"]
```

### Get all columns with types

```console
>> all_columns = _dbmanager.get_all_column_types(table="STUDENTS")

{"student_id": "TEXT", "name": "TEXT", "mark": "INT"}
```

### Get columns type

```console
>> _dbmanager.get_column_type(table="STUDENTS", column="student_id")

"TEXT"
```

### Get primary key of a table

```console
>> _dbmanager.get_primary_key(table="STUDENTS")

"student_id"
```

Expand All @@ -135,13 +138,15 @@ True

```console
>> _dbmanager.get_all_records(table="STUDENTS", primary_key="1010")

[{'student_id': '1010', 'name': 'ABC', 'mark': 10, 'year': '2022'}, {'student_id': '1011', 'name': 'DEF', 'mark': 100, 'year': '2022'}]
```

### Get record from a table

```console
>> _dbmanager.get_record(table="STUDENTS", primary_key="1010")

{'student_id': '1010', 'name': 'ABC', 'mark': 10, 'year': '2022'}
```

Expand All @@ -155,9 +160,12 @@ True

```console
>> _dbmanager.filter_records(table="STUDENTS", values={"year":"2022"})

[{'student_id': '1010', 'name': 'ABC', 'mark': 10, 'year': '2022'}, {'student_id': '1011', 'name': 'DEF', 'mark': 100, 'year': '2022'}]
```

---

## 🌱 Contributing Guide

- Fork the project from the `alpha` branch and submit a Pull Request (PR)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name="ReallySimpleDB",
version="0.0.2",
version="1.0",
description="A tool for easily manage databases with Python",
long_description=long_description,
long_description_content_type="text/markdown",
Expand Down

0 comments on commit 6bcf82b

Please sign in to comment.