Skip to main content

An open-source accounting package,aiming at Narrating Accounting just using Python.

Project description

Due to the existence of framing bias in natural language, we have developed Python narrative packages that includes politicsnlp, economynlp, religionnlp, lawnlp, and cpanlp, enabling us to communicate within a common framework and avoid misunderstandings caused by different frames of reference.

Example

sales increased 12% compared with fourth quarter 2021:

  • North America segment sales increased 13% year-over-year to $93.4 billion, or increased 14% excluding changes in foreign exchange rates.
  • International segment sales decreased 8% year-over-year to $34.5 billion, or increased 5% excluding changes in foreign exchange rates.
  • AWS segment sales increased 20% year-over-year to $21.4 billion.
sale1 = p.Sale(quarter="Q4",amount=93.4,unit="billion dollars",growth_rate=13%,year=2022,segment="North America")
sale2 = p.Sale(quarter="Q4",amount=34.5,unit="billion dollars",growth_rate=-8%,year=2022,segment="International")
sale3 = p.Sale(quarter="Q4",amount=21.4,unit="billion dollars",growth_rate=20%,year=2022,segment="AWS")
sales = [sale1, sale2, sale3]
total_sales = 0
for s in sales:
    total_sales += s.amount
    print(f"Segment: {s.segment}, Sale: {s.amount}")

print(f"Total Sales: {total_sales}")
logo

Narrating Accounting! using Python Developed by Cpanlp Intelligent Accounting Team (c) 2023 Github

PyPI - Python Version Downloads

Install & Import

Dependencies

  • scipy
  • numpy
  • pandas

For detailed installation instructions, see the documentation.

pip install cpanlp
import cpanlp as p

Features

  1. Accounting Item
gold_asset = p.Asset(account="gold", debit=1000,date="2023-01-01")
print(gold_asset.bubble)
  1. Information Asymmetry
info = p.AsymmetricInformation(sender="investor", receiver="company_A", message="I am very interested in investing in your business", hidden_information="I have a limited budget")
info.get_advantage()
  1. Entrepreneur
john = p.Entrepreneur(name="John Smith",age=30,wealth=100000,utility_function=0, experience=5,company=LLC("Apple","Electronics",1000000),entrepreneurship=Entrepreneurship(leadership=9.0))
john.strive_for_excellence()
  1. Strategy
huawei = p.FinancialStrategy("huawei","defense",poison_pill(1000,0.1))

Accounting Language Decorator :

@prob(probability=0.7) #Estimate

@future_tense #Future Tense

side_effects=["financial instability","loss of reputation","decreased employee morale"]
@with_side_effects(side_effects=side_effects)#Side Effects 

Accounting Exception :

if abs(percent_change) > 10:
  raise AbnormalFluctuation(stock_name, percent_change)

Module:

Module Content
Abnormal Winner CurseBubble
Accounting Account AssetLiabilityEquityIncomeCashflow
Business Main BusinessCapacity
${\color{blue}Contract}$ AgreementArrangementMOUCommitment LetterLeaseLoan ContractLabor ContractFinancial Instrument
Cognitive BlackSwanGrey RhinoHerd BehaviorInvisible HandRevolving Door
Control Voting PowerCommodity ControlSignificant Influence
Culture EntrepreneurshipCraftsmanshipBusiness Philosophy
${\color{purple}Decorator}$ EstimateTenseImportanceWith EffectsValidator
Department Board Of DirectorsSupervisory Board
Economic System Digital EconomyPhysical EconomyMarket EconomyPlanned Economy
Entity LLC(Limited Liability Company)PartnershipPublic CompanySME(Small and medium-sized enterprises)Conglomerate
Environment Economic EnvironmentIndustry EnvironmentCredit EnvironmentMarket Environment
Event AcquisitionCertificationGrantsMeetingResignationRepurchasePersonnelRegistrationSharesLawsuitStockHoldingIncrease
${\color{purple}Exception}$ Abnormal FluctuationBubbleWinner Curse
Information SignalSpeculative InformationAsymmetric Information
Incentive
Institution
Market CommodityGoodsMarket Structure
Person ${\color{red}Consumer}$,EmployeeEntrepreneurManagerInvestorPartnerShareholderSupervisorCreditorAuditorBeneficiaryFiduciaryCraftsman
Policy AccountingPolicyDividendPolicy
Project
Pragmatics Promise
Risk
StakerHolder BankGovernmentMediaPublicRating Agency
Scheme Ponzi SchemeESOPDebtRestructuringPlan
Strategy Long Term StrategyFinancial Strategy
Tax VAT(Value-Added Tax)Consumption TaxPersonal Income TaxCorporate Income TaxRealEstate TaxTransactionTax
Team
Utility

Accounting Gym-Env

logo

Check out: https://cpanlp.com

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

cpanlp-1.2.39.tar.gz (82.7 kB view hashes)

Uploaded Source

Built Distribution

cpanlp-1.2.39-py3-none-any.whl (139.7 kB view hashes)

Uploaded Python 3

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