Giter Club home page Giter Club logo

fastapi's People

Contributors

madscheme avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fastapi's Issues

Unused imports

from copy import copy
from .init import (conn, curs, get_db, IntegrityError)
from model.creature import Creature
from error import Missing, Duplicate

creature.py:1:18: F401 [*] `copy.copy` imported but unused
creature.py:2:20: F401 [*] `.init.conn` imported but unused
creature.py:2:32: F401 [*] `.init.get_db` imported but unused

Useless os.getenv

fastapi/data/init.py

Lines 19 to 24 in fd72f02

if not name:
top_dir = Path(__file__).resolve().parents[1] # repo top
db_dir = top_dir / "db"
db_name = "cryptid.db"
db_path = str(db_dir / db_name)
name = os.getenv("CRYPTID_SQLITE_DB", db_path)

On line 24, os.getenv is called to get an environment variable value or to default to calculated name. But the call is made in a scope where it is known that the os.getenv call will return None, so the use of name is certain.

May as well change the code to use name directly without calling os.getenv.

fetchall / fetchone

fastapi/data/game.py

Lines 6 to 10 in fd72f02

curs.execute(qry)
rows = curs.fetchall()
if rows:
print(f"{rows=}")
name = rows[0][0]

If this is supposed to work with only one row, may as well call fetchone instead of fetchall.

Unused imports

fastapi/data/init.py

Lines 5 to 6 in fd72f02

from sqlite3 import connect, IntegrityError, Connection, Cursor
from error import Missing, Duplicate

init.py:5:30: F401 [*] `sqlite3.IntegrityError` imported but unused
init.py:6:19: F401 [*] `error.Missing` imported but unused
init.py:6:28: F401 [*] `error.Duplicate` imported but unused

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.