This is one of my favourites. A travel sized can of aerosol body spray is a very effective (and legal) substitute for mace or pepper spray. There are some other legal alternatives but body spray is available in many shops and it's not expensive. I've taken body spray to the eyes before and I can personally guarantee that it's debilitating. Use it at arms length, straight to the attackers face and make a swift exit; don't forget to call the police as soon as you're safe to inform them of the attack and possible casualty. DON'T stop to try and administer first aid yourself and shout to anyone in the immediate area that this person just attacked you. Bear in mind that there's a chance you could blind your attacker so be responsible and don't use this unless you're in genuine danger.
Your phone is really a very valuable personal safety tool. This doesn't mean you should flaunt it to the world (or you're asking to be mugged) but it could get you out of a sticky situation. Not just useful for contacting the emergency services, you should be using it to let a trusted person know where you are, when you're setting off on a journey and what time you expect to arrive. There are also a number of personal safety apps that you might find useful. Don't wander along the road absorbed in texting or gaming, it makes you a very easy and appealing target, especially if you're rocking a hot piece of bling like this...
A torch, in my opinion, is one of the most important of tools to have on you - a small one will do. Useful for checking dark areas or lighting your footing, especially in the winter when it gets dark very early. A torch makes fiddly jobs like getting a key into a lock in the dark a doddle - when all your attention is focussed on something quite small is when you're most at risk so make sure you can see what you're doing to speed up the process. Many LED torches also come with a flashing function, which is great for signalling your whereabouts if you need to be found - cycling head torches are a prime example. You don't have to spend a lot, I got mine for the princely sum of £1 from a thrift shop which shall remain nameless.
Whistles are very small and can be kept on your keyring or in your bag. The point is to make lots of noise. You can get personal alarms or small air horn style alarms as well which do the same job. There are pros and cons to each option - I'd say the air horn is the weakest of the three options so go for an alarm, whistle or both. You should make as much noise as you can vocally as well in an attack situation.
A sharp pencil or ball point pen can be an effective close range weapon if you get grabbed, plus they're legal to carry. Aim for soft and / or vital areas such as the throat or eyes; if you're not in a position to be choosey about your target then jab it in wherever you can and be ready to struggle free and run. You need to be aware that stabbing an attacker in this manner, even if it's with a pen or pencil, can result in fatality so it's a method you should only resort to if you're in genuine danger.
Ever heard the term 'handbagging'? If you have a bag with a strap and a bit of weight in it you can use it very effectively to strike and to help maintain distance between you and your attacker. Aim for your attacker's head: it's instinct to throw up your arms and protect your face when an object comes towards it at speed, which is a good chance for you to get out of dodge. Besides, you need something to keep the other bits of your survival kit in! I'd also like to make it clear that I'm not condoning the use of handbags for acts of vigilanteism, as seen in this video.