- TinyDB - Discussion
- TinyDB - Useful Resources
- TinyDB - Quick Guide
- TinyDB - Extensions
- TinyDB - Extend TinyDB
- TinyDB - Middleware
- TinyDB - Storage Types
- TinyDB - Caching Query
- TinyDB - Default Table
- TinyDB - Tables
- TinyDB - Document ID
- TinyDB - Retrieving Data
- TinyDB - Upserting Data
- TinyDB - Modifying the Data
- TinyDB - Handling Data Query
- TinyDB - Logical OR
- TinyDB - Logical AND
- TinyDB - Logical Negate
- TinyDB - The one_of() Query
- TinyDB - The All() Query
- TinyDB - The Any() Query
- TinyDB - The Test() Query
- TinyDB - The Matches() Query
- TinyDB - The Exists() Query
- TinyDB - The where Clause
- TinyDB - Searching
- TinyDB - Querying
- TinyDB - Delete Data
- TinyDB - Update Data
- TinyDB - Retrieve Data
- TinyDB - Insert Data
- TinyDB - Environmental Setup
- TinyDB - Introduction
- TinyDB - Home
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
TinyDB - Environmental Setup
Prerequisite for TinyDB setup
To install TinyDB, you must have Python 3.6 or newer installed in your system. You can go to the pnk
and select the latest version for your OS, i.e., Windows and Linux/Unix. We have a comprehensive tutorial on Python, which you can refer atInstalpng TinyDB
You can install TinyDB in three different ways: using the Pack Manager, from its Source, or from GitHub.
Using the Package Manager
The latest release versions of TinyDB are available over both the package managers, pip and conda. Let us check how you can use them to install TinyDB −
To install TinyDB using pip, you can use the following command −
pip install tinydb
To install TinyDB via conda-forge, you can use the following command −
conda install -c conda-forge tinydb
From Source
You can also install TinyDB from source distribution. Go to pnk
to download the files and building it from source.From GitHub
To install TinyDB using GitHub, grab the latest development version, unpack the files, and use the following command to install it −
pip install
Setting up TinyDB
Once installed, use the following steps to set up the TinyDB database.
Step 1: Import TinyDB and its Query
First, we need to import TinyDB and its Query. Use the following command −
from tinydb import TinyDB, Query
Step 2: Create a file
TinyDB database can store data in many formats pke XML, JSON, and others. We will be creating a JSON file by using the following file −
db = TinyDB( Leekha.json )
The above command will create an instance of TinyDB class and pass the file Leekha.Json to it. This is the file where our data will be stored. Now, the TinyDB database set up is ready, and you can work on it. We can now insert data and operate the value in the database.
Uinstalpng TinyDB
If in case you need to uninstall TinyDB, you can use the following command −
pip uninstall tinydbAdvertisements