Skip to content

Commit

Permalink
Merge pull request #4 from NotFrancee/readme_update
Browse files Browse the repository at this point in the history
Update README and License
  • Loading branch information
franceschiniandrea authored Nov 28, 2023
2 parents 1758933 + e4b4e44 commit 26c2e28
Show file tree
Hide file tree
Showing 4 changed files with 1,600 additions and 10 deletions.
21 changes: 21 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2023 Andrea Franceschini

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
71 changes: 61 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,59 @@
# MPL BSIC Package
<br/>
<p align="center">
<a href="https://github.com/NotFrancee/mpl_bsic">
<img src="images/logo.png" alt="Logo" height="80">
</a>

<h3 align="center">mpl-bsic</h3>

<p align="center">
Create matplotlib plots in BSIC Style!
<br/>
<br/>
<a href="https://mpl-bsic.readthedocs.io/en/latest/"><strong>Explore the docs »</strong></a>
<br/>
<br/>
<a href="https://github.com/NotFrancee/mpl_bsic/issues">Report Bug</a>
-
<a href="https://github.com/NotFrancee/mpl_bsic/issues">Request Feature</a>
</p>
</p>

![Contributors](https://img.shields.io/github/contributors/NotFrancee/mpl_bsic?color=dark-green) ![Issues](https://img.shields.io/github/issues/NotFrancee/mpl_bsic) ![License](https://img.shields.io/github/license/NotFrancee/mpl_bsic)


## About the Project

<div align="center">
<img src="images/about_project.svg" alt="Plot Example" align='center'>
</div>

This package allows you to style matplotlib plots using BSIC Style (fonts, colors, logos, etc.) to later use them in BSIC articles. It also
provides utility function to handle the formatting of the axis, check the size of the figures, and more!

Read the sections below for an overview of how to install and use the package. For further information, be sure to [read the docs](https://mpl-bsic.readthedocs.io/en/latest/)!

## Table Of Contents

* [About the Project](#about-the-project)
* [Installation](#installation)
* [Docs and TLDR](#docs-and-tldr)
* [If the matplotlib fonts do not work](#if-the-matplotlib-fonts-do-not-work)
* [Contributing](#contributing)
* [Roadmap](#roadmap)

## Installation

The package supports all python versions starting from `3.9.0`

To install, run

```
pip install mpl_bsic
pip install mpl-bsic
```

Then you can import the functions from the module, for example

The package supports all python versions starting from 3.9
Then you can import the functions from the module, for example

```
from mpl_bsic import apply_bsic_style
Expand All @@ -21,8 +64,9 @@ from mpl_bsic import apply_bsic_style
Read the docs on [this link](https://mpl-bsic.readthedocs.io/).
All the functions are explained extensively and you can find example code/plots.

**WARNING**: Be sure to read the docs for apply_bsic_style, and in particular how it handles the title of the plot.
If you don't follow that rule, the title of the plot will be rendered using Garamond and not Gill Sans MT (which is the correct font which should be used). And also read carefully the part about the figsize to use, especially when exporting to use in a Word file.
**WARNING**: Be sure to read the docs for apply_bsic_style, and in particular how to make sure the style gets applied. You always have to make sure you call `plt.show()`
(if in a script) even if you only plan to export the plot, since otherwise matplotlib won't run the animations which are required to apply the style to the title.
And also read carefully the part about the figsize to use, especially when exporting to use in a Word file.

A brief overview of the functions of the module:

Expand All @@ -34,13 +78,20 @@ A brief overview of the functions of the module:
You can specify the time unit (yearly, monthly, daily), the frequency (e.g. a tick every 3M), and the format (e.g. MM/YYYY or MMM YYYY)
* `preprocess_dataframe`: preprocesses a dataframe, by setting the index to the date (and converting to datetime)
and transforming all the columns to lowercase for easier use in the project
* `plot_trade`: this function is WIP
* `plot_trade`: WIP

## If the matplotlib fonts do not work

Check the full guide on the documentation. Anyway, you need to install
Garamond and Gill Sans MT and clear your matplotlib cache.
Garamond and Gill Sans MT on your system and clear your matplotlib cache.

## Contributing

If you have any ideas, features you would like to have implemented, or you find out any bugs within the function, be sure
to open an issue and I will work on it as soon as possible. Or you can also fork the repo yourself and make a pull request
to the project!

## Coming Next / TODOs (if you have any ideas be sure to tell me)
## Roadmap

1) plot trade (as bloomberg with last price and stuff)
1) plot trade (as bloomberg with last price and stuff)
2) plot tables (instead of having to style them using Excel)
Loading

0 comments on commit 26c2e28

Please sign in to comment.