Alternately: you can note the day you first and last ate from the container.
Or what I used to do: make tally marks on the container to figure out how many portions it typically provides; then, going forward, count a "standard" portion of that food accordingly.
A month is a long time and the measurement error will accumulate every day, especially with fats. Not so much problem if you do that with cucumber or spinach.
Over several months the errors will average out. Unless you eat out a lot, then the above method doesn't work. However if you are single (this is the most unlikely factor!) and cook most meals at home then calories in the door - what you throw away = calories that you ate. That is good enough.
I have a whole food, plant-based diet and I cook all my own food. I don't buy any processed food, anything with anything animal in it, refined sugar, refined oils (except olive oil for the air fryer), refined carbohydrates, things preserved with salt/vinegar/oil or any stimulants. For B12 I eat Marmite (UK). Most of what I eat is that rare thing: fresh vegetables.
Because I eat almost everything (sometimes there are bad apples), I throw very little away and that includes packaging too, where I am surprised at how little that amounts to. I have a small box for recycling and I only have to empty it ever two to three months.
I could cheat and not keep the receipt on a huge box of chocolates, beer and biscuits but I would only be fooling myself.
As for bread, I just buy flour and yeast, to put it in the breadmaking machine. I buy wholemeal flour which is white flour with some of the stripped off parts of the wheat thrown back in. I am happy with that compromise as it makes a very nice loaf.
Apart from Marmite, nothing I buy has much of an ingredients label, a cauliflower is a cauliflower and has no ingredients.
The receipts are my way of accounting, I could look at them all for the last year and buy everything I need that is shelf-stable for the year ahead.
Mayonnaise used to be something I did eat a lot of, but now that is on the banned list, and I have no idea why I would ever want to eat that stuff nowadays.
I eat to satiety and beyond, my physical activity consists of walking/cycling and I am fitter than I have ever been with a digestive tract that is rock solid. Bloating, constipation or the runs are alien conditions to me, I also get a 'long range bladder' into the deal.
I don't count calories, my goal is to get as many as possible from just vegetables, beans, legumes, nuts, grains and fruit. I love cooking and my 'self care' routine. Since there are seasons, my food always changes, right now spring greens are floating my boat.
The idea of keeping the receipts is to have all of them with no banned items in them, and also to track my nutrition experiments. At the moment I am trying to do a year long streak of 'an apple a day' to see what that is about.
Regarding counting macronutrients, why bother? Nobody counts fibre, which is crucial for the lower gut, with protein we eat 2x in the West and nobody is counting phytochemicals in plants beyond the 'five a day' thing. With the exception of bread, everything I eat counts towards the 'five a day' so I am probably on twenty portions of fruit or veg a day, not that I am counting.
I don't mind people wanting to diet to fit into a dress for a special event, that is something that works for them, albeit with yoyoing. I want to be at my fittest during the summer months, to go cycling, and, during winter, I don't care. In this way I am embracing yoyoing, however, my weight does not go up over winter, I just lose some muscle, to get it back again during spring.
That trick is to focus on months instead of days. Then count your calories when you buy the food instead of when you eat it. For example lets say you buy a loaf of bread. It is 100 calories per slice and there are 17 slices. Add 1700 to your calorie count for the month.
At the end of the month you can approximate your average daily calories as the amount of calories you bought that month divided by the number of days.
Some things you buy in a month might last into the next month. That will introduce some variation but over longer periods it should cancel out. If you want you can smooth that out a bit by logically splitting those items when they have a lot of calories.
For example consider jar of mayonnaise that might last a few months and is 8000 calories. Instead of counting all 8000 in the month you buy it you can count it as 2000 that month and 2000 more each of the next 3 months.