How to use if elif and else in python to perform an action to create a new json file each month, the first day of each month?

I am new to python and I need your help!

I have a python script that stores a row of data every minute for every day and every month of the year. However, since there is so much data stored per day, the json file ends up with 518,400 lines of data per year, with a size of 67 MB.

I need to make a script that performs an action to create a new json file every first day of every month of the year, therefore it will not accumulate all of the data for the year ; year in a single file, which will result in a json file for January, February, March … December.

The first idea I had was to use if elif and else in python, but I don't know how to do it.

Does anyone know how I can do this?

[ Politics ] Open question: do you think Ivanka Trump will one day be president?

[Politics] Open question: Do you think Ivanka Trump will one day be president?

10% profit on #BTC! Binance Day Trading: where to enter and exit profitable trading advice

Visit us forever vuhttps: //t.me/cryptosignalalert crypto trading strategy, world class Bitcoin Bot and assistance on crypto trading – https://t.me/cryptosignalalert

wssBYWs.png "data-src =" https://i.imgur.com/wssBYWs.png "src =" https://topgoldforum.com/applications/core/interface/js/spacer.png "/>
</p>
<p>	10% profit on # BTC-USDT regardless of any exchange. The #BTC trend has been detected and Crypto members were already informed – See the #BTC chart now on any trade – It has skyrocketed to generate great profits.
</p>
<p>	These are incredible benefits for our members who trade on #Binance. Even if you trade on any major exchange like Bitmex, Binance.US, Coinbase Pro, Bybit or Kraken – It is a great profit and can be traded anywhere .
</p>
<p>	Enter the Crypto group and receive early signals with a precise stop loss and target levels to make a constant profit every day – Once you are in the Crypto group, you only get quality signals.
</p>
<p>  . </p>
<div data-id=