Skip to main content

Functions for microeconomic analysis

Project description

pyMicroeconomics

pyMicroeconomics is a Python package designed for symbolic analysis and visualization of market equilibrium conditions. This package allows you to define various supply and demand curves, calculate market equilibrium points, and visualize these using interactive plots. It integrates several powerful libraries, such as Sympy and Matplotlib, making it a versatile tool for microeconomic analysis.

Features

  • Define different types of supply and demand curves (linear, power, exponential, quadratic).
  • Calculate key market metrics, including equilibrium price and quantity.
  • Compute consumer surplus, producer surplus, and total surplus.
  • Visualize market equilibrium interactively with ipywidgets and Matplotlib.

Table of Contents

  1. Getting Started
  2. Installation
  3. Usage Examples
  4. Documentation
  5. Contributing
  6. License
  7. Acknowledgments

Getting Started

To get started with pyMicroeconomics, follow these steps:

Prerequisites

  • Python 3.8 or later
  • Jupyter Notebook or JupyterLab for interactive usage

Installation

To install pyMicroeconomics, use pip:

pip install pyMicroeconomics

This package is intended to be used interactively within Jupyter Notebooks to visualize economic concepts dynamically.

Setting Up the Environment

You can also use the provided Dockerfile and devcontainer.json to set up a complete development environment. This is especially useful if you use Visual Studio Code or GitHub Codespaces. To start developing with pyMicroeconomics, clone the repository and spin up a Docker container:

git clone https://github.com/joshhilton/pyMicroeconomics.git
cd pyMicroeconomics
docker build -t pymicroeconomics .
docker run -it -v $(pwd):/app pymicroeconomics

Usage Examples

Example 1: Basic Market Equilibrium

Below is a simple example of finding the market equilibrium using linear supply and demand curves:

import pyMicroeconomics as pm

# Define demand and supply curves
demand = pm.linear_demand()
supply = pm.linear_supply()

# Calculate equilibrium
equilibrium = pm.market_equilibrium(demand, supply)

# Display equilibrium details
pm.display_equilibrium(equilibrium)
pm.plot_equilibrium(equilibrium)

This visualization allows users to adjust the parameters interactively and observe changes in real-time.

Documentation

The complete documentation for pyMicroeconomics, including detailed guides, examples, and the API reference, is available here.

If you need specific help on running tests or contributing, check out the Developer Guide and Testing Guide in the docs/ directory.

Contributing

We welcome contributions to the project! Please follow these steps to get involved:

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature/AmazingFeature).
  3. Commit your changes (git commit -m 'Add some AmazingFeature').
  4. Push to the branch (git push origin feature/AmazingFeature).
  5. Open a Pull Request.

Please refer to the CONTRIBUTING.md document for more detailed guidelines.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Built using SymPy, Matplotlib, and ipywidgets.

If you have any questions or need further help, please feel free to open an issue on GitHub.

Badges

PyPI - Python Version Build Status License


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

pymicroeconomics-0.0.6.tar.gz (14.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pymicroeconomics-0.0.6-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file pymicroeconomics-0.0.6.tar.gz.

File metadata

  • Download URL: pymicroeconomics-0.0.6.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for pymicroeconomics-0.0.6.tar.gz
Algorithm Hash digest
SHA256 e0b63148517155496ca3b792f45957f77dbb4ff4a53a122fd1d5bec5c9afa5c0
MD5 f247ec1ff8222a17cc5fa4fcbc93d44f
BLAKE2b-256 396ea46c8ad214181f7791c85027f351bb0ca4cc269c02a313b0d1a89c1f5b2d

See more details on using hashes here.

File details

Details for the file pymicroeconomics-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for pymicroeconomics-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 7f4847cf13c1d88759e8a9747e5e7afc6caa9d3ec7c7e279e38d0197234bdb92
MD5 e6368f6256efd39c8bbbf02564f52f5f
BLAKE2b-256 a7767af4e164a0019b35d8026130c97ea80acf6b32099ad8abd254aeb29e4dc7

See more details on using hashes here.

Supported by

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