Skip to main content

My personal utilities library.

Project description

qwertypy

My personal utilities library.

Installation

pip install qwertypy

Upgrade

pip install --upgrade qwertypy

Usage

qwertypy.greetings

import qwertypy.greetings as qpyGreetings

print(qpyGreetings.hello())

qwertypy.tickertape

qwertypy.tickertape.companies

import qwertypy.tickertape.companies as ttCompanies

topCompanies = ttCompanies.getTopCompanies()
print("TOP = ", len(topCompanies))
# print("ALL = ", len(ttCompanies.getAllCompanies()))

ttName = "reliance-industries-RELI"
companyInfo = ttCompanies.getCompanyInfo(ttName)
print(companyInfo)

qwertypy.tickertape.financials

import qwertypy.tickertape.financials as ttFinancials

ttName = "reliance-industries-RELI"
for statementType in ttFinancials.statementTypes:
    statement = ttFinancials.getStatement(ttName, statementType)
    print(statementType, type(statement))

ttName = "reliance-industries-RELI"
statementType = ttFinancials.statementTypes["income"]
statement = ttFinancials.getStatement(ttName, statementType)
yearsAndValues = ttFinancials.getYearsAndValues(statement, "incDps")
print(yearsAndValues)

qwertypy.data_analysis

qwertypy.data_analysis.regression

import qwertypy.data_analysis.regression as qpyRegression

xTrain = [1, 2, 3, 4, 5, 6]
yTrain = [2, 4, 6, 8, 10, 12]
model = qpyRegression.QpyLinearRegression(xTrain, yTrain)
model.train()
yPredict = model.getPrediction()
print("yPredict: ", yPredict)

xPredict2 = [10, 11]
yExpected = [20, 22]
yPredict2 = model.getPrediction(xPredict2)
print("yPredict2: ", yPredict2)

qwertypy.data_plots

qwertypy.data_plots.trend_plot

import qwertypy.data_analysis.regression as qpyRegression
import qwertypy.data_plots.trend_plot as qpyTrendPlot
import qwertypy.tickertape.companies as ttCompanies
import qwertypy.tickertape.financials as ttFinancials

ttName = "reliance-industries-RELI"
companyInfo = ttCompanies.getCompanyInfo(ttName)
statementType = ttFinancials.statementTypes["income"]
statement = ttFinancials.getStatement(ttName, statementType)
yearsAndValues = ttFinancials.getYearsAndValues(statement, "incTrev")
xTrain = [int(x) for x in list(yearsAndValues.keys())]
yTrain = [yearsAndValues[x] for x in yearsAndValues]
model = qpyRegression.QpyLinearRegression(xTrain, yTrain)
model.train()
yPredict = [round(val, 2) for val in model.getPrediction()]
qpyTrendPlot.trendPlot(
    xTrain, yTrain,
    "Years", "Revenue (INR Cr.)", companyInfo["name"],
    trendValues = yPredict,
    legends = ["Revenue trend", "Revenue (INR Cr.)"],
    text = "text", watermark = "qwertypy",
    # saveToFile = "testImage.jpg",
    # showValues = True
)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qwertypy-0.5.2.tar.gz (7.1 kB view details)

Uploaded Source

File details

Details for the file qwertypy-0.5.2.tar.gz.

File metadata

  • Download URL: qwertypy-0.5.2.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for qwertypy-0.5.2.tar.gz
Algorithm Hash digest
SHA256 b248ea241baad5f8ab3b4957cf4bcc608cff49a12db3b1c1b119f4b995d02a67
MD5 d23679b85f1de535bfc5bf9e0db29d5c
BLAKE2b-256 62994cb2d304e521ff27e897bd62b760aefae4fae15120e5dce94817ee32c366

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page