Skip to main content

sfctools - A toolbox for stock-flow consistent, agent-based models

Sfctools is a lightweight and easy-to-use Python framework for agent-based macroeconomic, stock-flow consistent (ABM-SFC) modeling. It concentrates on agents in economics and helps you to construct agents, helps you to manage and document your model parameters, assures stock-flow consistency, and facilitates basic economic data structures (such as the balance sheet). For more documentation, see https://sfctools-framework.readthedocs.io/en/latest/.

Installation

We recommend to install sfctools in a fresh Python 3.8 environment. For example, with conda, do

conda create --name sfcenv python=3.8
conda activate sfcenv
conda install pip

Then, in a terminal of your choice, type:

pip install sfctools

see https://pypi.org/project/sfctools/

You can also build the software wheel directly from the git repository using the commands

pip uninstall sfctools -y
poetry build 
pip install <filename of .whl file in dist/folder>

This command requires poetry. It will uninstall sfctools and install the specified version

Usage with Graphical User Interface 'Attune'

Type

python -m sfctools attune

to start the GUI.

Usage inside Python

Try out this simple example:

from sfctools import Agent, World 

class SomeAgent(Agent):
    def __init__(self, a):
        super().__init__()
        self.some_attribute = a

my_agent = SomeAgent(a='Hello')
your_agent = SomeAgent(a='World')

my_agents = World().get_agents_of_type("SomeAgent")
my_message = my_agents[0].some_attribute
your_message = my_agents[1].some_attribute

print("%s says %s, %s says %s" % (my_agent, my_message, your_agent, your_message))

The resulting output will be

SomeAgent__00001 says Hello, SomeAgent__00002 says World

More Examples

Have a look at the documentation page for more examples.

Cite this Software

You can cite the software as follows:

Baldauf, T., (2023). sfctools - A toolbox for stock-flow consistent, agent-based models. Journal of Open Source Software, 8(87), 4980, https://doi.org/10.21105/joss.04980

You can cite the software repository as follows:

Thomas Baldauf. (2023). sfctools - A toolbox for stock-flow consistent, agent-based models (1.1.0.2b). Zenodo. https://doi.org/10.5281/zenodo.8118870


| Corresponding author: Thomas Baldauf, German Aerospace Center (DLR), Curiestr. 4 70563 Stuttgart | thomas.baldauf@dlr.de |

Download files

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

Source Distribution

sfctools-1.1.9.4.tar.gz (635.8 kB view details)

Uploaded Source

Built Distribution

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

sfctools-1.1.9.4-py3-none-any.whl (717.3 kB view details)

Uploaded Python 3

File details

Details for the file sfctools-1.1.9.4.tar.gz.

File metadata

  • Download URL: sfctools-1.1.9.4.tar.gz
  • Upload date:
  • Size: 635.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.20

File hashes

Hashes for sfctools-1.1.9.4.tar.gz
Algorithm Hash digest
SHA256 7624e51ed00a6e3c86ec549dcd51690043087d9f1a487d600a2f12c5f61153b5
MD5 f01944e2d018ac6387c8978fe5061efb
BLAKE2b-256 81a4570d811f29fc495885d0fa9b039cc57675a4c49f3a2e2bc1bd78a822ee7a

See more details on using hashes here.

File details

Details for the file sfctools-1.1.9.4-py3-none-any.whl.

File metadata

  • Download URL: sfctools-1.1.9.4-py3-none-any.whl
  • Upload date:
  • Size: 717.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.8.20

File hashes

Hashes for sfctools-1.1.9.4-py3-none-any.whl
Algorithm Hash digest
SHA256 779d13116795f224d6e55a70303068578ffb443611b87963f538027ca7552b9b
MD5 3602aa973e1d89862accb72bde829cf6
BLAKE2b-256 c19d69e4b0b01a7ae3de9fb245421929e5f801d58d56ebcc4605edfcba1b7b02

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

1.1.9.4 This release

2 files

1.1.9.3

2 files

1.1.9.2

2 files

1.1.9.1

2 files

1.1.9.0

2 files

1.1.8.0

2 files

1.1.7.7

2 files

1.1.7.6

2 files

1.1.7.5

2 files

1.1.7.4

2 files

1.1.7.3

2 files

1.1.7.2

2 files

1.1.7.1

2 files

1.1.6.0

2 files

1.1.5.7

2 files

1.1.5.6

2 files

1.1.5.3

2 files

1.1.5.2

2 files

1.1.5.1

2 files

1.1.5.0

2 files

1.1.4.11

2 files

1.1.4.1

2 files

1.1.4.0

2 files

1.1.3.23

2 files

1.1.3.22

2 files

1.1.3.21

2 files

1.1.3.1

2 files

1.1.3.0

2 files

1.1.2.7

2 files

1.1.1.6

2 files

1.1.0.6

2 files

1.1.0.5

2 files

1.1.0.3

2 files

1.1.0.2

2 files

1.1.0.1

2 files

1.0.6.7

2 files

1.0.6.6

2 files

1.0.6.4

2 files

1.0.6.3

2 files

1.0.6.2

2 files

1.0.6.1

2 files

1.0.6.0

2 files

1.0.5.9

2 files

1.0.5.8

2 files

1.0.5.7

2 files

1.0.5.6

2 files

1.0.5.5

2 files

1.0.5.4

2 files

1.0.5.3

2 files

1.0.5.2

2 files

1.0.5.1

2 files

1.0.5.0

2 files

1.0.4.200

2 files

1.0.4.183

2 files

1.0.4.182

2 files

1.0.4.18

2 files

1.0.4.17

2 files

1.0.4.16

2 files

1.0.4.15

2 files

1.0.4.15b0

2 files

1.0.4.14

2 files

1.0.4.13

2 files

1.0.4.12

2 files

1.0.4.11

2 files

1.0.4.11b0

2 files

1.0.4.2

2 files

1.0.4.1

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.9.9

2 files

0.9.8

2 files

0.9.7

2 files

0.9.6

2 files

0.9.5

2 files

0.9.4

2 files

0.9.3

2 files

0.9.2

2 files

0.9.1

2 files

0.9.0

2 files

0.8.3

2 files

0.8.2

2 files

0.8.1

2 files

0.8

2 files

0.7.4

2 files

0.7.3

2 files

0.7.2

2 files

0.7.1

2 files

0.7.0

2 files

0.5.0

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

Supported by

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