JSON Continued
- Refer Here to look at the sample to read and write the data from json file
YAML
- Similar to JSON, YAML has keys and values
name: python # text
age: 25 # number
is_scripting_supported: yes # boolean
used_in: #list
- web applications
- stand alone applications
- machine learning
note:
zenofpython: PEP-20
sytle_guide: PEP-8
- Lets try to rewrite the library program to work with yaml
- Refer Here for the changeset containing yaml code base
Database Programming in Python
- An application programming Interface (API) is a set of functions that you can call to get access to some service. DB-API is a python’s standard API for accessing relational databases.
- Refer Here for the official documentation
- Its main functions are
- connect(): Make a connection to the database. This can include arguments such as username, password, server address and others
- cursor(): Create a cursor object to manage queries
- execute() and executemany(): Run one or more SQl commands against the database
- fetchone(), fetchmany() and fetchall() Get the resuls for execute
SQLite
- This is a good, light, opensource relational database.
- This is implemented as a standard python library and stores databases in normal files.
- These files are portable and work across machines and operating system
- Install DB Browser for sqlite Refer Here
- Refer Here for the python standard library module sqlite3 which consits of necessary methods to interact with sqllite3 database
Like this:
Like Loading...